import {WidgetClass} from "../atom/widget";

export class ServiceCall extends WidgetClass {
  constructor(options = {}) {
    super(options);
    const {ports,UI} = options;
    if (UI) {
      this.UI.data = UI.data;
    }
    if (ports) {
      this.ports = ports;
    } else {
      this.ports = this.assembleDefaultPorts();
    }
  }

  assembleDefaultState(options = {}) {
    const superState = super.assembleDefaultState(options);
    return {
      ...superState,
    };
  }

  assembleDefaultPorts() {
    const superState = super.assembleDefaultPorts();
    return {
      ...superState,
      values: [
        ...superState.values,
        {
          name: "会议信息",
          key: "meeting",
          type: "map",
          value: "",
        },
      ],
      events: [
        ...superState.events,
        {
          name: "取消服务",
          key:  "cancelServer",
          eventType: "custom",
          type: "event",
          action: [],
        },
        {
          name: "呼叫服务",
          key: "serviceCall",
          type: "event",
          eventType: "custom",
          action: [],
        }
      ],
    };
  }
}
